<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
    <caption>员工列表</caption>
    <tr>
        <th>名字</th><th>工资</th><th>工作</th>
    </tr>
    <!--v-for遍历数组,arr是遍历的数组变量,
    emp代表遍历出来的每一个员工对象-->
    <tr v-for="emp in arr">
        <td>{{emp.name}}</td>
        <td>{{emp.salary}}</td>
        <td>{{emp.job}}</td>
    </tr>
</table>

<!--引入vue框架-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    let v = new Vue({
        el:"table",
        data:{
            arr:[{name:"悟空",salary:3000,job:"销售"},
                {name:"八戒",salary:4000,job:"人事"},
                {name:"沙僧",salary:5000,job:"程序员"}]
        }
    })
</script>
</body>
</html>